-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export LLVM plugin entrypoint for windows shared library builds #115431
base: main
Are you sure you want to change the base?
Conversation
Add Symbol visibility macro to llvmGetPassPluginInfo so plugins export it for windows shared library builds with explicit symbol visibility macros enabled. This avoids the need for existing plugins having to manually add visibility macros to there llvmGetPassPluginInfo function to work on windows. This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on window.
@compnerd, can we make another review round? |
extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK | ||
llvmGetPassPluginInfo(); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we can share most of the declaration between the platforms, it is only the attribute that differs.
extern "C" ::llvm::PassPluginLibraryInfo
#if defined(_WIN32)
#if defined(LLVM_BUILD_LLVM_DYLIB)
__declspec(dllexport)
#endif
#else
LLVM_ATTRIBUTE_WEAK
#endif
llvmGetPassPluginInfo();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks a really painful way to declare it.
@fsfod, this one looks towards its final phase. Can you address the comments? |
Add Symbol visibility macro to llvmGetPassPluginInfo so plugins export it for windows shared library builds with explicit symbol visibility macros enabled. This also avoids the need for existing plugins having to manually add visibility macros to there llvmGetPassPluginInfo function to work on windows.
This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on window.